<?php
html::printPath('foreignPoliceExport.form-title', 'foreignPoliceExport.form-title-hint');
$msg->printMessages();

// html::actionLists(array('' => ''));

echo '<div class="quickSearchField">';
$fb = new FormBuilder('person', array());
$fb->setFormId('addPersonForm');
$fb->setAction('/admin/foreignPoliceExport/addPerson');
$fb->autocompleter('person_id', $personOptions)->mustMatch()->labelKey('foreignPoliceExport.addPerson');
$fb->submitButton('button-add')->id('addPersonSubmitButton');
$fb->write();
echo '</div>';

$listView = new View('admin/foreignPoliceExport/foreignPoliceExportList');
$listView->render(true);
?>

<script type="text/javascript">
jQuery('#addPersonSubmitButton').click(function(event) {
	var $personId = $('#person_id');
	if ($personId.val()) {
		var addPersonForm = document.getElementById('addPersonForm');
		
		Yosemin.Ajax.partialPageUpdate(null, addPersonForm, null, null);
		$personId.val('');
		$(addPersonForm).find('.ui-autocomplete-input').val('');
	}
	event.preventDefault();
	return false;
});
</script>
